import request from '@/router/axios'
import {
  fenExYuangettoFixed,
  fenExYuangettoFixed2,
  fenExYuangettoFixed3,
  getLineName,
  getQianxiangType,
  getStationName
} from "../../../../../subwayRat/commonCheck";
import store from '@/store';

/**
 *  票款差异
 * @param param
 * @returns {*}
 */
export function get_xw_SwAuTvmMoneyAssistListJD(param) {
  return request({
    url: '/check/checkNew/get_xw_SwAuTvmMoneyAssistListJD',
    method: 'post',
    data: param,
    params: param
  })
}
/**
 *  票款差异
 * @param param
 * @returns {*}
 */
export function get_xw_SwAuTvmMoneyAssistListOther(param) {
  return request({
    url: '/check/checkNew/get_xw_SwAuTvmMoneyAssistListOther',
    method: 'post',
    data: param,
    params: param
  })
}


/**
 *  提交
 * @param param
 * @returns {*}
 */
export function submitData_xw_SwAuTvmMoneyAssist(param) {
  return request({
    url: '/check/checkNew/submitData_xw_SwAuTvmMoneyAssist',
    method: 'post',
    data: param
    //params: param
  })
}

/**
 *  获取数据
 * @param param
 * @returns {*}
 */
export function get_xw_SwAuTvmBoxAmountDifference(param) {
  return request({
    url: '/check/checkNew/get_xw_SwAuTvmBoxAmountDifference',
    method: 'post',
    params: param
  })
}


/**
 *  编辑数据
 * @param param
 * @returns {*}
 */
export function editor_xw_SwAuTvmBoxAmountDifference(param) {
  return request({
    url: '/check/checkNew/editor_xw_SwAuTvmBoxAmountDifference',
    method: 'post',
    params: param,
    data: param
  })
}


/**
 * 导出
 * @param query
 */
 export function exportTvmMoneyAssist(query) {
  return request({
    url: '/check/checkNew/exportTvmMoneyAssist',
    method: 'get',
    params: query,
    responseType:'blob'
  })
}


/**
 * 撤回TVM分钱箱票款差异
 * @param query
 */
 export function revokeTvmFenQianXiang(query) {
  return request({
    url: '/check/checkNew/revokeTvmFenQianXiang',
    method: 'post',
    params: query,
    data:query,
  })
}

export const xw_TVMXTSJCY_cols1= {
  emptyBtn: false,
  editBtn: false,
  delBtn: false,
  addBtn: false,
  border: true,
  index: false,
  header:false,
  menu:false,
  indexLabel: '序号',
  align: 'center',
  menuWidth: 150,
  menuAlign: 'center',
  selection: false,
  reserveSelection: false,
  column: [{
    label: '钱箱类型',width:120,
    prop: "cashBoxType",
    formslot: true,
    formatter: function (row, value, label, column) {
      return getQianxiangType(value);
    },
  },
    // {
    //   label: '钱箱编号',
    //   prop: "cashBoxCode",
    //   formslot: true,
    // },
    {
      label: '系统金额',width:140,
      prop: "systemMoney",
      // formslot: true,
      // formatter:function (row,v) {
      //   if(row.boxUninstallStatus==1){
      //     return v
      //   }else{
      //     return '未卸载';
      //   }
      // }
    },
    {
      label: '协查系统金额',
      prop: "replyDsiplayMoney",
      cell: true,
      type:'number',
      disabled: true,
      precision:2,
      width:140,
    },
    {
      label: '显示金额差异',
      prop: "diffUnloadDisplayMoney",
      formatter:function (row,v) {
        if(row.boxUninstallStatus==1){
          row.diffUnloadDisplayMoney=row.tvmUnloadMoney-row.replyDsiplayMoney;
          return row.diffUnloadDisplayMoney;
        }else{
          return '';
        }
      },
      hide: true
    },
    {
      label: '实点金额',
      prop: "actualMoneyNew",
      formatter:function (row,v) {
        return fenExYuangettoFixed2(row.handOutMoney+row.actualMoney);
      },
    },
    {
      label: '差异金额',
      prop: "replyActualMoneyNew",
      formatter:function (row,v) {
        return fenExYuangettoFixed3(fenExYuangettoFixed2(row.handOutMoney+row.actualMoney)-row.systemMoney);
      },
      //type:'number',
      //cell: true,
      disabled: true,
      precision:2,
      width:140,
    },
    {
      label: '协查补卸载金额',width:140,
      prop: "loadUnloadMoney",
      formatter:function (row,v) {
        if(row.boxUninstallStatus==3){
          return v;
        }else{
          return '0.00';
        }
      },
      hide:true
    },
    {
      label: '协查补卸载金额',
      prop: "replyLoadUnloadMoney",
      cell: true,
      disabled: true,
      width:140,
      type:'number',
      precision:2,
      hide:true
    },
    {
      label: '补卸载金额差异',
      prop: "diffLoadUnloadMoney",
      formatter: function (row,v) {
        if(row.boxUninstallStatus==3){
          row.diffLoadUnloadMoney=row.loadUnloadMoney-row.replyLoadUnloadMoney*100;
          return row.diffLoadUnloadMoney;
        }else{
          return '';
        }
      },
      hide:true
    },
    {
      label: '补币金额',width:140,
      prop: "supplementMoney",
      formslot: true,
    },
    {
      label: '协查补币金额',
      prop: "replySupplementMoney",
      disabled: true,
      cell: true,
      width:140,
      type:'number',
      precision:2,
    },
    {
      label: '补币金额差异',
      prop: "diffSupplementMoney",
      formatter:function (row,v) {
        row.diffSupplementMoney=row.supplementMoney-row.replySupplementMoney;
        return row.diffSupplementMoney;
      },
      hide:true
    },
    {
      label: '手工清出金额',width:140,
      prop: "handOutMoney",
      hide:true
    },
    {
      label: '协查手工清出金额',
      prop: "replyHandOutMoney",
      disabled: true,
      cell: true,
      width:140,
      type:'number',
      precision:2,
      hide:true
    },
    {
      label: '手工清出金额差异',
      prop: "diffHandOutMoney",
      formatter:function (row,v) {
        row.diffHandOutMoney=row.handOutMoney-row.replyHandOutMoney;
        return row.diffHandOutMoney;
      },
      hide:true
    }

    ]
};
